!<template>
  <div class="main">
    <a
      @click="handleChange"
      type="text"
      :class="['sider-trigger-a', collapsed ? 'collapsed' : '']"
      ><Icon :type="icon" :size="size"
    /></a>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    collapsed: Boolean,
    icon: {
      type: String,
      default: "navicon-round",
    },
    size: {
      type: Number,
      default: 40,
    },
  },
  methods: {
    handleChange() {
      //子父传值
      this.$emit("on-change", !this.collapsed);
    },
  },
};
</script>
<style lang="scss" scoped>
.sider-trigger-a {
  width: 100%;
  height: 100%;
  text-align: center;
  border: 1px solid red;
  display: inline-block;
  color: white;
 vertical-align: middle;
  i {
    transition: transform 0.2s ease;
    vertical-align: middle;
  }
  &.collapsed i {
    transform: rotateZ(90deg);
    transition: transform 0.2s ease;
  }
}
</style>